﻿using System;
using System.Collections.Generic;

namespace Components.Data.UI.MasterPages
{
  public class MasterPageBindingCollection : List<MasterPageBinding>
  {
    public MasterPageBinding this[String path]
    {
      get
      {
        return this.Find(mpb => mpb.Path == path);
      }
      set
      {
        MasterPageBinding masterPageBinding = this.Find(mpb => mpb.Path == path);

        if (masterPageBinding != null)
        {
          masterPageBinding = value;
          return;
        }
        this.Add(value);
      }
    }
  }
}